package com.cmwa.solution.sys.permission.dataAuthority.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cmwa.solution.base.controller.BaseController;
import com.cmwa.solution.base.entity.Page;
import com.cmwa.solution.base.entity.SearchParam;
import com.cmwa.solution.sys.permission.dataAuthority.entity.RoleVo;
import com.cmwa.solution.sys.permission.dataAuthority.service.DataAuthorityService;


/**
 * 数据权限查询
 * @author ex-zhangjia
 * @Date 2016年5月23日 下午15:26:35
 * @Description
 */
@Controller
@RequestMapping(value ="/sys/dataAuthority")
public class DataAuthorityController extends BaseController {
	/**
	 * 设置jsp的访问路径
	 */
	private final static String PAGE_PATH = "system/sys/permission/dataAuthority/"; 
	/**
	 * 数据权限Service
	 */
	@Resource
	private DataAuthorityService dataAuthorityService;
	
	
	/**
	 * 数据权限查询页面
	 * @param model
	 * @return
	 * @author ex-zhangjia
	 */
	@RequestMapping("/dataAuthorityListView")
	public String dataAuthorityListView(ModelMap model) {
		return PAGE_PATH + "dataAuthorityList";
	}
	
	/**
	 * 数据权限分页数据
	 * @param sp
	 * @return
	 * @author ex-zhangjia
	 */
	@RequestMapping("/dataAuthorityListPage")
	@ResponseBody
	public Page<RoleVo> dataAuthorityListPage(SearchParam sp) {
		Page<RoleVo> list = dataAuthorityService.dataAuthorityListPage(sp);
		return list;
	}
	
}
